const files = import.meta.globEager("./*.vue");
let pages = [];
for (const key in files) {
  if (Object.prototype.hasOwnProperty.call(files, key)) {
    const pathArray = key.split("/");
    const [name] = pathArray[pathArray.length - 1].split(".");
    const component = files[key].default;
    try {
      if (component.meta) {
        pages.push({
          path: `/${component.name}`,
          name: component.name,
          meta: component.meta,
          component,
        });
      }
    } catch (e) {}
  }
}

pages = pages.sort((a, b) => a?.meta?.sort - b?.meta?.sort);
export default pages;
